package com.ruoyi.comments.service.impl;

import com.ruoyi.comments.domain.StudentEvaluationWithFeedback;
import com.ruoyi.comments.mapper.StudentEvaluationMapper;
import com.ruoyi.comments.service.IStudentEvaluation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 尹欣雨
 * @verdion 520
 * 19:24
 */
@Service
public class StudentEvaluationImpl implements IStudentEvaluation {
    @Autowired
    private StudentEvaluationMapper studentEvaluationMapper;
    /**
     * 根据学生学号和评价学期获取评价信息
     * @param studentId
     * @param commitTime
     * @return
     */
    @Override
    public StudentEvaluationWithFeedback selectOneEvaluation(String studentId, String commitTime) {
        return studentEvaluationMapper.selectOneEvaluation(studentId,commitTime);
    }

    /**
     * 获取全部信息
     * @return
     */
    @Override
    public List<StudentEvaluationWithFeedback> selectListEvaluationList() {
        return studentEvaluationMapper.selectListEvaluationList();
    }

    /**
     * 更新操作
     * @param studentEvaluationWithFeedback
     * @return
     */
    @Override
    public int updateStudentEvaluation(StudentEvaluationWithFeedback studentEvaluationWithFeedback) {
        return studentEvaluationMapper.updateStudentEvaluation(studentEvaluationWithFeedback);
    }

    /**
     * 新增信息
     * @param studentEvaluationWithFeedback
     * @return
     */
    @Override
    public int insertStudentEvaluation(StudentEvaluationWithFeedback studentEvaluationWithFeedback) {
        return studentEvaluationMapper.insertStudentEvaluation(studentEvaluationWithFeedback);
    }
}
